package com.edu.exam.enums.examination.paper;

/**
 * OMR质量等级枚举
 *
 * @author System
 * @version 1.0.0
 */
public enum OmQualityGrade {
    EXCELLENT("EXCELLENT", "优秀"),
    GOOD("GOOD", "良好"),
    ACCEPTABLE("ACCEPTABLE", "可接受"),
    POOR("POOR", "差"),
    UNACCEPTABLE("UNACCEPTABLE", "不可接受"),
    VERY_HIGH("VERY_HIGH", "非常高"),
    HIGH("HIGH", "高"),
    MEDIUM("MEDIUM", "中等"),
    LOW("LOW", "低"),
    VERY_LOW("VERY_LOW", "非常低");

    private final String code;
    private final String description;

    OmQualityGrade(String code, String description) {
        this.code = code;
        this.description = description;
    }

    public String getCode() {
        return code;
    }

    public String getDescription() {
        return description;
    }

    public static OmQualityGrade fromCode(String code) {
        for (OmQualityGrade grade : OmQualityGrade.values()) {
            if (grade.code.equals(code)) {
                return grade;
            }
        }
        throw new IllegalArgumentException("Unknown OMR quality grade code: " + code);
    }

    @Override
    public String toString() {
        return description;
    }
}
